#define  _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <assert.h>

int GetChar(const char* dest)
{
    assert(dest);

    char* first = dest;
    char* end = dest;

    while (*end++ != '\0')
    {
        if (*(end - 1) == ' ')
        {
            first = end;
        }
    }
    int count = 0;
    while (*first++ != '\0')
    {
        count++;
    }

    return count;
}

int main()
{
    char ch[500] = { 0 };
    gets(ch);
    getchar();

    printf("%d\n", GetChar(ch));

    return 0;
}